#include"display.h"
#include"hgmcu.h"
uchar code smgsz[]={
0xC0,0xF9,0xA4,0xB0,
0x99,0x92,0x82,0xF8,
0x80,0x90,0x88,0x83,
0xC6,0xA1,0x86,0x8E};
void xs(uint num,uchar t)
{
	ge=num%10;
	shi=num%100/10;
	bai=num%1000/100;
	ge=smgsz[ge];
	shi=smgsz[shi];
	bai=smgsz[bai];
	display(bai,shi,ge,t,3);
}
void delay(uchar z)   //?? -0.0625us
{
	unsigned char a,b,x;
	for(x=z;x>0;x--)
  		for(b=130;b>0;b--)
      	 		for(a=19;a>0;a--);
}
void display(uchar bai,uchar shi,uchar ge,uchar cyc,uchar time)
{
uchar xh;
for(xh=0;xh<cyc;xh++)
		{
			P0=bai;//????
			P21=0;
			delay(time);
			P21=1;
			P0=shi;//????
			P22=0;
			delay(time);
			P22=1;
			P0=ge;//????
			P23=0;
			delay(time);
			P23=1;
		}
}